﻿@using GBFinance.Entity;
@using HiLand.Utility4.MVC.Controls
@using HiLand.Framework.BusinessCore
@model IncomeAssetEntity
@{
    Layout = null;

    MvcControlUsingModes usingMode = (this.ViewContext.Controller as GBFinance.Web.Controllers.BaseLoanController).GetUsingMode();
    bool isPopLayer = (this.ViewContext.Controller as GBFinance.Web.Controllers.BaseLoanController).CheckIsPopLayer(); 

    IncomeAssetEntity entity = Model;
}
<style type="text/css">
    .hlDiv .span
    {
        width: 150px;
        text-align: right;
    }
</style>
<div id="UAssetStatementDetailsContainer">
    @using (Html.BeginForm())
    { 
        <fieldset id="securedDetails" class="simpleFieldset">
            <legend>Source of Income Details</legend>
            @Html.HiTextBox().Name("ItemName").Value(Model.ItemName).Lable("Source of Income").UsingMode(usingMode).Render()
            @Html.HiTextBox().Name("ItemValue").Value(Model.ItemValue.ToString()).Lable("Net Income/month").UsingMode(usingMode).Render()
            @Html.HiddenFor(m => m.ItemGuid)
        </fieldset>
    }
    @if (isPopLayer == true)
    {
        <div class="notification attention png_bg">
            <a href="#" class="close">
                <img src="@Url.Content("~/Content/NotificationImages/cross_grey_small.png")" title="Close this notification"
            alt="close" /></a>
            <div class="notificationContent">
                You can close this PopWindow by the key "Esc".
            </div>
        </div>
        <input type="button" value="Save" id="btnSave" />
        <script type="text/javascript">
            $(document).ready(function () {
                $("#UAssetStatementDetailsContainer #btnSave").click(function () {
                    $("#UAssetStatementDetailsContainer form").ajaxSubmit({
                        success: function (responseInfo) {
                            if (responseInfo.IsSuccessful == false) {
                                alert(responseInfo.statusMessage);
                            }
                            else {
                                //alert(responseInfo.IsSuccessful);
                                window.location.reload();
                            }
                        },
                        data: { "isAjaxDeal": "true" }
                    });
                });
            });
        </script>
    }
</div>
